package com.bjpowernode;

import com.bjpowernode.service.StudentService;
import com.bjpowernode.entity.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class MyTest01 {

    @Test
    public void test01(){

        String configure="applicationContext.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(configure);

         StudentService service=(StudentService)applicationContext.getBean("StudentService");
        Student student=new Student(7,"爱新觉罗.皇太极","5569@qq.com",25);
        List<Student> students = service.queryAllStudents();
       /* for(Student s:students){
            System.out.println(s);
        }*/
        int result=service.addStudent(student);
        System.out.println("结果"+result);
    }
}
